<?php
 require_once 'php_includes.php';
	//require_once 'admin_options.php';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="styles.css"/>
	<script type="text/javascript" src="pwcheck.js">
	</script>
  </head>
  <body>
  
	<?php writeHeader(); ?>
      <p></p>
     <div class="center">
		<p>
     <span class="pageheader"> Admin Delete Manager </span>
     </p>
     </div>
     <br />
     <form action = "adminMgrDel.php" method = "post">
       <div class="center">
       <select name = "Managers">
        <?php 
           sqlConnect();

           $managers = 'select ManagerID,EmployeeFName,EmployeeLName, COUNT(ManagerID) FROM Employee GROUP BY ManagerID';
           $theResult = sqlQuery($managers);
           $theRow = mysql_fetch_row($theResult);
     
        do{
            if($theRow[3] == 1)
            {
              echo "<option value = $theRow[0]> $theRow[0]  $theRow[1]  $theRow[2] </option>";
            }
            $theRow = mysql_fetch_row($theResult);
          }while($theRow);
          sqlExit();
        ?>
        </select>
        <p>
             <input type ="Submit" value = "Delete Manager" class="button"/>
        </p>
         </select>
         </div>
        </form>
        <br />
        <p></p>
        <div class="center">
		<p>
        <span class="pageheader"> Admin Transfer Manager </span>
        </p>
        </div>
        <br />
        <form action = "adminTransfer.php" method = "post">
       <div class="center">
        <pre><p>FROM       :     To     </p></pre>
        <select name = "firstManager">
        <?php 
           sqlConnect();

           $managers = 'select EmployeeID, EmployeeFName, EmployeeLName FROM Employee WHERE EmployeeID IN (select distinct(ManagerID) from Employee)';
           $theResult = sqlQuery($managers);
           $theRow = mysql_fetch_row($theResult);
     
        do{
            echo "<option value = $theRow[0]> $theRow[0]  $theRow[1]  $theRow[2] </option>";
            $theRow = mysql_fetch_row($theResult);
          }while($theRow);
        ?>
        </select>
        <select name = "SecondManager">
        <?php 
           sqlConnect();

           $managers = 'select EmployeeID, EmployeeFName, EmployeeLName FROM Employee WHERE EmployeeID IN (select distinct(ManagerID) from Employee)';
           $theResult = sqlQuery($managers);
           $theRow = mysql_fetch_row($theResult);
     
        do{
            echo "<option value = $theRow[0]> $theRow[0]  $theRow[1]  $theRow[2] </option>";
            $theRow = mysql_fetch_row($theResult);
          }while($theRow);
          sqlExit();
        ?>
        </select>
        <p>
             <input type ="Submit" value = "Transfer Employees" class="button"/>
        </p>
         </div>
        </form>

</body>
</html>
	